home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / Direct3D / Screensavers / Moire / readme.txt < prev    next >
Text File  |  2001-10-10  |  5KB  |  92 lines

  1. //-----------------------------------------------------------------------------
  2. // Name: Moire Direct3D Sample
  3. // 
  4. // Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
  5. //-----------------------------------------------------------------------------
  6.  
  7.  
  8. Description
  9. ===========
  10.    The Moire sample shows how to use the DXSDK screensaver framework to write
  11.    a screensaver that uses Direct3D.  The screensaver framework is very similar
  12.    to the sample application framework, using many methods and variables with 
  13.    the same names.  After writing a program with the screensaver framework, one
  14.    ends up with a fully-functional Windows screensaver rather than a regular 
  15.    Windows application.
  16.  
  17.    The Moire screensaver appears as a mesmerizing sequence of spinning lines
  18.    and colors.  It uses texture transformation and alpha blending to create a 
  19.    highly animated scene, even though the polygons that make up the scene do 
  20.    not move at all.
  21.    
  22.  
  23. Path
  24. ====
  25.    Source:     DXSDK\Samples\Multimedia\D3D\Screensavers\Moire
  26.    Executable: DXSDK\Samples\Multimedia\D3D\Bin
  27.  
  28.  
  29. User's Guide
  30. ============
  31.    Moire.scr can be started in five modes: configuration, preview, full, test, 
  32.    and password-change.  You can choose some modes by right-clicking the 
  33.    moire.scr file and choosing Configure or Preview.  Or you can start moire.scr 
  34.    from the command line with the following command-line parameters:
  35.       -c          Configuration mode
  36.       -t          Test mode
  37.       -p          Preview mode
  38.       -a          Password-change mode
  39.       -s          Full mode
  40.  
  41.    When the screensaver is running in full mode, press any key or move the 
  42.    mouse to exit.
  43.     
  44.  
  45. Programming Notes
  46. =================
  47.    Programs that use the screensaver framework are very similar to programs
  48.    that use the D3D sample application framework.  Each screensaver needs to
  49.    create a class derived from the main application class, CD3DScreensaver.
  50.    The screensaver implements its own versions of the virtual functions 
  51.    FrameMove(), Render(), InitDeviceObjects(), etc., that provide 
  52.    functionality specific to each screensaver.
  53.  
  54.    Screensavers can be written to be multimonitor-compatible, without much
  55.    extra effort.  If you do not want your screensaver to run on multiple
  56.    monitors, you can just set the m_bOneScreenOnly variable to TRUE.  But
  57.    by default, this value is false, and your program needs to be able to
  58.    handle multiple D3D devices.  The function SetDevice() will be called each
  59.    time the device changes.  The way that Moire deals with this is to create
  60.    a structure called DeviceObjects which contains all device-specific 
  61.    pointers and values.  CMoireScreensaver holds an array of DeviceObjects
  62.    structures, called m_DeviceObjectsArray.  When SetDevice() is called, 
  63.    m_pDeviceObjects is changed to point to the DeviceObjects structure for
  64.    the specified device.  When rendering, m_rcRenderTotal refers to the 
  65.    rendering area that spans all monitors, and m_rcRenderCurDevice refers 
  66.    to the rendering area for the current device's monitor.  The function
  67.    SetProjectionMatrix shows one way to set up a projection matrix that
  68.    makes proper use of these variables to render a scene that optionally
  69.    spans all the monitors, or renders a copy of the scene on each monitor,
  70.    depending on the value of m_bAllScreensSame (which can be controlled by
  71.    the user in the configuration dialog, if you want).
  72.  
  73.    The ReadSettings() function is called by the screensaver framework at
  74.    program startup time, to read various screensaver settings from the 
  75.    registry.  DoConfig() is called when the user wants to configure the
  76.    screensaver settings.  The program should respond to this by creating
  77.    a dialog box with controls for the various screensaver settings.  This
  78.    dialog box should also have a button called "Display Settings" which, 
  79.    when pressed, should call DoScreenSettingsDialog().  This common dialog
  80.    allows the user to configure what renderer and display mode should be 
  81.    used on each monitor.  You should set the member variable m_strRegPath 
  82.    to a registry path that will hold the screensaver's settings.  You can 
  83.    use this variable in your registry read/write functions.  The screensaver
  84.    framework will also use this variable to store information about the
  85.    default display mode in some cases.
  86.  
  87.    This sample makes use of common DirectX code (consisting of helper functions,
  88.    etc.) that is shared with other samples on the DirectX SDK. All common
  89.    headers and source code can be found in the following directory:
  90.       Dxsdk\Samples\Multimedia\Common
  91.  
  92.